package com.keqing.controller;

import com.ganyu.domain.ResponseResult;
import com.ganyu.service.impl.UploadServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * DATA: 2022/9/27
 * Author: 晨夕
 */
@RestController
@RequestMapping
public class AdminUploadController {
    @Autowired
    private UploadServiceImpl uploadServiceImpl;
    @PreAuthorize("@ps.hasPermission()")
    @PostMapping("/upload")
    public ResponseResult uploadImg(@RequestParam("img") MultipartFile img){
        return uploadServiceImpl.uploadImg(img);
    }
}
